package com.example.demo.service.impl;

import com.example.demo.dao.RoleDao;
import com.example.demo.domain.po.Role;
import com.example.demo.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 角色服务层实现
 * @Author: zsg
 * @Date: 2018/07/06 09:50
 */

@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleDao roleDao;

    @Override
    public Role findRoleByRole(String role) {
        Role queryByRole = this.roleDao.queryByRole(role);
        return queryByRole;
    }

    @Override
    public Role findRoleById(Long id) {
        Role role = this.roleDao.queryById(id);
        return role;
    }

    @Override
    public void insert(Role role) {
        this.roleDao.insert(role);
    }
}
